/*
 * Copyright (c) 2008, Xiong Yingfei, the University of Tokyo
 * All rights reserved.
 */
package ac.jp.u_tokyo.SyncLib.language3;

import ac.jp.u_tokyo.SyncLib.dictionaries.KeyFactory;

public class GlobalIncrementalFactory implements KeyFactory<Integer>
{

	public Integer createNewKey(Iterable<Integer> existingKeys)
	{
		return ++seed;
	}
	
	public Integer createNewKey() {
		return ++seed;
	}
	
	public static Integer staticCreateNewKey() {
		return ++seed;
	}

	private static Integer seed = 0;
	
	public static void reset() {
		seed = 0;
	}
	public static void reset(int i) {
		seed = i;
	}

}
